﻿Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Seuss.EnterpriseLibrary.BusinessLogic
Imports Seuss.EnterpriseLibrary.DataAccess
Imports System.Collections.Generic
Imports System.Data.SqlClient
Imports System.Data

Partial Class Consulta_PA_Alumno
    Inherits System.Web.UI.Page
    Dim cPerCodigo As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Response.Expires = -1
        Response.AddHeader("Pragma", "no-cache")
        Response.AddHeader("cache-control", "private")
        Response.CacheControl = "no-cache"
        cPerCodigo = Request.QueryString("cPerCodigo")
        If Not Page.IsPostBack Then
            lblcPercodigo.Text = cPerCodigo
            lblNombre.Text = CargarNombre(lblcPercodigo.Text)
            Using Seguridad As New BLL_Administracion
                Seguridad.Set_Transaccion_Insert(Nothing, 100401, IdentityUser.UserCode, My.Request.UserHostAddress.ToString, CrearXMLTransaccion("Consulta Pagina Movil", "/Pagina|" + My.Request.Url.Segments(My.Request.Url.Segments.Length - 1).ToString))
            End Using
        End If
    End Sub

    Private Function CargarNombre(ByVal cPerCodigo As String) As String
        Dim ldr As New List(Of IDataReader)
        Dim Nombre As String = "Usuario de UCV"
        Using ObjPool As New PoolDbCommand()
            Dim ObjUsuario As New DAL_Kiosco(ObjPool.Database)
            ObjPool.AddDbCommand(ObjUsuario.Get_NombrePariente_By_cPerCodigo(cPerCodigo), PoolDbCommand.PoolDbCommandResultType.Query)
            ObjPool.Pooling(Nothing, ldr, True)
            ObjUsuario = Nothing
            While ldr(0).Read
                Nombre = ldr(0).Item("NombreCompleto").ToString()
            End While
        End Using

        Return Nombre
    End Function
End Class

